<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/7/8 0008
 * Time: 09:43
 */

namespace app\api\controller\v1\agent;


use app\api\controller\v1\Agent;
use app\currency\service\AgentService;
use think\Db;

class Team extends Agent
{
    /**
     * 获取所有团队列表
     */
    public function index()
    {
        $ids = AgentService::getTeamIds($this->aid);
        $where = [['status','eq','1'],['id','in',$ids]];
        $list = $this->_query('Cleaner')->where($where)
            ->page(true,false,false,10);
        $this->success('success',$list);
    }
    protected function _index_page_filter(&$data)
    {
        foreach ($data as &$datum) {
            $datum['blacklist_num'] = Db::name('MemberBlacklist')->where('cid',$datum['id'])->count();
        }
    }
}